package com.android.vspice;

import java.util.ArrayList;
import java.util.List;

import com.android.vspice.swig.Element;

public class ElementList {
	private List<Element> items;
	
	private ElementList() {
		items = new ArrayList<Element>();
		items.clear();
	}
	
	private static ElementList instance = null;
	
	public static ElementList getInstance() {
		if(instance == null)
			instance = new ElementList();
		
		return instance;
	}
	
	public Element getItem(int index) {
		return items.get(index);
	}
	
	public void setItems(Element[] e) {
		int count = e.length;
		
		for(int i = 0 ; i < count ; i++) {
			items.add(e[i]);
		}
	}
	
	public void delItem(int index) {
		items.remove(index);
	}
	public void clear() {
		items.clear();
	}
}
 